
/**
 var values = {name: 'misko', gender: 'male'};
 var log = [];
 angular.forEach(values, function(value, key){
  this.push(key + ': ' + value);
}, log);
 expect(log).toEqual(['name: misko', 'gender:male']);
 */

/**
 * Created by Camus on 11/10/13.
 */
function Eventos($http,$scope,angularFire){
    $scope.eventos=[];
    $scope.eventos=getEventosLocalStorage();
    //sincronizarListaDeEventos($http,$scope);
}

function cargarListaEventos($scope,angularFire){
    var ref = new Firebase(getFireBaseEventUrl());
    angularFire(ref,$scope,"eventos");
}

//DEPRECADO
function sincronizarListaDeEventos($http,$scope){
    var idsEvento=getEventosLocalStorage();
    var index=0;
    while(index<idsEvento.length){
        var idEvento=idsEvento[index].id;
        actualizarListaDeEventos($http,$scope,idEvento);
        index++;
    }
}
//DEPRECADO
function actualizarListaDeEventos($http,$scope,idEvento){
    getDataJsonRest($http,getFireBaseEventUrlById(idEvento),
        function(data, status, headers, config) {
            $scope.eventos.push(data);
        },
        function(data, status, headers, config){
            alert("error");
        }
    )


}
